/**
 * 
 */
package org.whereiswally.model;

import java.io.Serializable;
import java.net.URI;

/**
 * @author LGIAVEDO
 * 
 */
public class WallyFace implements Comparable, Serializable {

    private URI picture;
    private long faceNumber;
    // % wally
    private long wallyAverage = 0L;

    public WallyFace(URI picture, long faceNumber, long wallyAverage) {
	super();
	this.picture = picture;
	this.faceNumber = faceNumber;
	this.wallyAverage = wallyAverage;
    }

    /**
     * @return the picture
     */
    public URI getPicture() {
	return picture;
    }

    /**
     * @param picture
     *            the picture to set
     */
    public void setPicture(URI picture) {
	this.picture = picture;
    }

    /**
     * @return the faceNumber
     */
    public long getFaceNumber() {
	return faceNumber;
    }

    /**
     * @param faceNumber
     *            the faceNumber to set
     */
    public void setFaceNumber(long faceNumber) {
	this.faceNumber = faceNumber;
    }

    /**
     * @return the wallyAverage
     */
    public long getWallyAverage() {
	return wallyAverage;
    }

    /**
     * @param wallyAverage
     *            the wallyAverage to set
     */
    public void setWallyAverage(long wallyAverage) {
	this.wallyAverage = wallyAverage;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Comparable#compareTo(java.lang.Object)
     */
    @Override
    public int compareTo(Object o) {
	return (int) (((WallyFace) o).getWallyAverage() - wallyAverage);
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
	return picture.toString() + " -> " + wallyAverage + "%\n";
    }

}
